<?= $this->Html->script('admin-price') ?>

<h1>
    Cene
    <span class="actions">
        <?= $this->Html->link('dodaj', 'javascript:void(0)', array(
            'onclick' => "addPriceGroup()",
            'title'   => 'Dodaj grupu',
            'class'   => 'add',
            'id'      => 'add-price-group-btn'
        )) ?>
        <span id="add-price-group" style="display:none">
            <input type="text">
            <a href="javascript:void(0)" class="action save" title="Sačuvaj">save</a>
            <a href="javascript:void(0)" class="action cancel" title="Poništi">cancel</a>
        </span>
    </span>
</h1>
<p><?= $this->Session->flash() ?></p>
<div class="tabs" id="price-tabs"<? if(empty($groups)): ?> style="display:none"<? endif ?>>  
    <ul>
    <? foreach ($groups as $id=>$name): ?>
        <li id="price-group-li-<?= $id ?>">
            <?= $this->Html->link($name, "/admin_cene/group/{$id}") ?>
            <?= $this->Html->link('obriši', 'javascript:void(0)', array(
                'onclick' => "remoteDelete('/admin_cene/delete_group/{$id}', {$id}, priceGroupDeleted)",
                'class'   => 'delete action',
                'title'   => 'Obriši grupu'
            )) ?>
        </li>
    <? endforeach ?>
    </ul>
</div>